<template>
	<view class="zy-column-full">
		<zy-title rightText="规范" @right="openPopup"></zy-title>
		<scroll-view class="zy-scroll">
			<view class="zy-text-white-lg-bold zy-ml-lg zy-mt-50" style="font-size: 48rpx;">想认识TA吗？</view>
			<view class="content-bg">
				<!-- 头像，昵称，用户信息 -->
				<view class="zy-row-between">
					<view class="zy-text-white-lg-bold">{{item.nick}}</view>
					<viwe>
						<image class="zy-img-sm zy-mr-sm" v-for="(item,index) in item.introPicIdUrl" :key="index" :src="item" ></image>
					</viwe>
				</view>
				<view class="zy-text-white-sm zy-font-bold zy-mb-lg">{{getInfo(item)}}</view>
				<zy-line dashed></zy-line>
				
				<!-- 身份信息 -->
				<view class=" zy-mt-50 zy-mb-lg">
					<view class="zy-text-white-lg-bold">身份信息</view>
					<view class="zy-row zy-mt">
						<view class="zy-flex zy-row">
							<view class="zy-text-whitegrey">学历:</view>
							<view class="zy-text-white">{{item.educStr || '保密'}}</view>
						</view>
						<view class="zy-flex zy-row">
							<view class="zy-text-whitegrey">年收入:</view>
							<view class="zy-text-white">{{item.incomeStr || '保密'}}</view>
						</view>
					</view>
					<view class="zy-row zy-mt">
						<view class="zy-flex zy-row">
							<view class="zy-text-whitegrey">职务:</view>
							<view class="zy-text-white">{{item.careerStr || '保密'}}</view>
						</view>
					</view>
				</view>
				<zy-line dashed></zy-line>
				
				<!-- 自我介绍 -->
				<view class=" zy-mt-50 zy-mb-lg">
					<view class="zy-text-white-lg-bold">自我介绍</view>
					<view class="zy-row zy-mt">
						<view class="zy-text-whitegrey">{{item.sign}}</view>
					</view>
				</view>
			</view>
		</scroll-view>
		
		<view class="zy-row zy-mh-lg">
			<zy-button class="zy-flex" content="忽略" hollow @click="toNext"></zy-button>
			<zy-button class="zy-flex zy-ml-lg" content="想！" @click="toUserInfo"></zy-button>
		</view>
		
		<uni-popup ref="popup">
			<zy-popup title="人气投票规范" content="人气投票，是小世界邀请诸位会员一起，投票人气用户的功能。请您本着客观公正的原则进行投票，通过您心目中符合标准的小世界用户。
投票过程请您遵守行为规范，保护申请人的隐私权利,切勿泄露申请人的认证资料，否则将受到封号处罚。
感谢每一位参与会员投票的评委，我们会尽心提供更优质的会员服务给大家"  confirmText="我知道了" hideCancel
				@ok="okPopup">
			</zy-popup>
		</uni-popup>
	</view>
</template>

<script>
	import RouteUtil from '@/main/common/RouteUtil.js'
	export default {
		data() {
			return {
				list:[],
				current:0,
				item:{}
			}
		},
		onLoad() {
			this.requestList(1)
		},
		methods: {
			requestList(pageNo){
				const params = {
					pageNo: pageNo,
					type: 1
				}
				uni.$http.get("/api/user/getUserPage", params)
					.then(res => {
						if(1==pageNo){
							this.list = res.data;
							this.item = this.list[0];
						}else{
							this.list.concat(res.data);
						}
					}).catch(res => {
					})
			},
			getInfo(item) {
				let info = item.age + "岁";
				if (item.areaStr) {
					info += " " + item.areaStr;
				}
				if (item.constellation) {
					info += " " + item.constellation;
				}
				return info;
			},
			toNext(){
				if(this.current == this.list.length-1){
					this.current = 0;
				}else{
					this.current++;
				}
				this.item = this.list[this.current]
				//什么时候请求下一页
			},
			toUserInfo(){
				RouteUtil.toUserInfo(this.item.txCode)
			},
			openPopup(){
				this.$refs.popup.open()
			},
			okPopup(){
				this.$refs.popup.close()
			}
		}
	}
</script>

<style lang="scss" scoped>
	.content-bg{
		background: #181B1C;
		border-radius: 30rpx;
		border: 1rpx solid #FFFFFF;
		margin: 50rpx 100rpx;
		padding: 30rpx 50rpx;
	}
</style>
